3.80 \(\int \frac{(d+e x) (a+b \log (c x^n))^2}{x^2} \, dx\)

Optimal. Leaf size=72 \[ -\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac{2 b d n \left (a+b \log \left (c x^n\right )\right )}{x}+\frac{e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac{2 b^2 d n^2}{x} \]

[Out]

(-2*b^2*d*n^2)/x - (2*b*d*n*(a + b*Log[c*x^n]))/x - (d*(a + b*Log[c*x^n])^2)/x + (e*(a + b*Log[c*x^n])^3)/(3*b
*n)

________________________________________________________________________________________

Rubi [A]  time = 0.116678, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238, Rules used = {2353, 2305, 2304, 2302, 30} \[ -\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac{2 b d n \left (a+b \log \left (c x^n\right )\right )}{x}+\frac{e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac{2 b^2 d n^2}{x} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(a + b*Log[c*x^n])^2)/x^2,x]

[Out]

(-2*b^2*d*n^2)/x - (2*b*d*n*(a + b*Log[c*x^n]))/x - (d*(a + b*Log[c*x^n])^2)/x + (e*(a + b*Log[c*x^n])^3)/(3*b
*n)

Rule 2353

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2302

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int \frac{(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx &=\int \left (\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x^2}+\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{x}\right ) \, dx\\ &=d \int \frac{\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx+e \int \frac{\left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx\\ &=-\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x}+\frac{e \operatorname{Subst}\left (\int x^2 \, dx,x,a+b \log \left (c x^n\right )\right )}{b n}+(2 b d n) \int \frac{a+b \log \left (c x^n\right )}{x^2} \, dx\\ &=-\frac{2 b^2 d n^2}{x}-\frac{2 b d n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x}+\frac{e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}\\ \end{align*}

Mathematica [A]  time = 0.0349871, size = 63, normalized size = 0.88 \[ -\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac{2 b d n \left (a+b \log \left (c x^n\right )+b n\right )}{x}+\frac{e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n])^2)/x^2,x]

[Out]

-((d*(a + b*Log[c*x^n])^2)/x) + (e*(a + b*Log[c*x^n])^3)/(3*b*n) - (2*b*d*n*(a + b*n + b*Log[c*x^n]))/x

________________________________________________________________________________________

Maple [C]  time = 0.258, size = 1544, normalized size = 21.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2/x^2,x)

[Out]

-b^2*(-e*x*ln(x)+d)/x*ln(x^n)^2-b*(-I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x+I*ln(x)*Pi*b*e*csgn(I*x^n)*cs
gn(I*c*x^n)*csgn(I*c)*x+I*ln(x)*Pi*b*e*csgn(I*c*x^n)^3*x-I*ln(x)*Pi*b*e*csgn(I*c*x^n)^2*csgn(I*c)*x+I*Pi*b*d*c
sgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I*Pi*b*d*csgn(I*c*x^n)^3+I*Pi*b*d*csgn
(I*c*x^n)^2*csgn(I*c)+e*n*b*ln(x)^2*x-2*ln(x)*ln(c)*b*e*x-2*ln(x)*a*e*x+2*ln(c)*b*d+2*b*d*n+2*a*d)/x*ln(x^n)+1
/12*(-12*I*ln(x)*ln(c)*Pi*b^2*e*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x+12*I*Pi*b^2*d*n*csgn(I*c*x^n)^3+12*I*Pi*
a*b*d*csgn(I*c*x^n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^4*csgn(I*c))/x

________________________________________________________________________________________

Maxima [A]  time = 1.12538, size = 154, normalized size = 2.14 \begin{align*} \frac{b^{2} e \log \left (c x^{n}\right )^{3}}{3 \, n} - 2 \, b^{2} d{\left (\frac{n^{2}}{x} + \frac{n \log \left (c x^{n}\right )}{x}\right )} + \frac{a b e \log \left (c x^{n}\right )^{2}}{n} - \frac{b^{2} d \log \left (c x^{n}\right )^{2}}{x} + a^{2} e \log \left (x\right ) - \frac{2 \, a b d n}{x} - \frac{2 \, a b d \log \left (c x^{n}\right )}{x} - \frac{a^{2} d}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^2,x, algorithm="maxima")

[Out]

1/3*b^2*e*log(c*x^n)^3/n - 2*b^2*d*(n^2/x + n*log(c*x^n)/x) + a*b*e*log(c*x^n)^2/n - b^2*d*log(c*x^n)^2/x + a^
2*e*log(x) - 2*a*b*d*n/x - 2*a*b*d*log(c*x^n)/x - a^2*d/x

________________________________________________________________________________________

Fricas [B]  time = 1.04042, size = 360, normalized size = 5. \begin{align*} \frac{b^{2} e n^{2} x \log \left (x\right )^{3} - 6 \, b^{2} d n^{2} - 3 \, b^{2} d \log \left (c\right )^{2} - 6 \, a b d n - 3 \, a^{2} d + 3 \,{\left (b^{2} e n x \log \left (c\right ) - b^{2} d n^{2} + a b e n x\right )} \log \left (x\right )^{2} - 6 \,{\left (b^{2} d n + a b d\right )} \log \left (c\right ) + 3 \,{\left (b^{2} e x \log \left (c\right )^{2} - 2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} e x - 2 \,{\left (b^{2} d n - a b e x\right )} \log \left (c\right )\right )} \log \left (x\right )}{3 \, x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^2,x, algorithm="fricas")

[Out]

1/3*(b^2*e*n^2*x*log(x)^3 - 6*b^2*d*n^2 - 3*b^2*d*log(c)^2 - 6*a*b*d*n - 3*a^2*d + 3*(b^2*e*n*x*log(c) - b^2*d
*n^2 + a*b*e*n*x)*log(x)^2 - 6*(b^2*d*n + a*b*d)*log(c) + 3*(b^2*e*x*log(c)^2 - 2*b^2*d*n^2 - 2*a*b*d*n + a^2*
e*x - 2*(b^2*d*n - a*b*e*x)*log(c))*log(x))/x

________________________________________________________________________________________

Sympy [A]  time = 8.28364, size = 182, normalized size = 2.53 \begin{align*} - \frac{a^{2} d}{x} + a^{2} e \log{\left (x \right )} - \frac{2 a b d n}{x} - \frac{2 a b d \log{\left (c x^{n} \right )}}{x} - 2 a b e \left (\begin{cases} - \log{\left (c \right )} \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{\log{\left (c x^{n} \right )}^{2}}{2 n} & \text{otherwise} \end{cases}\right ) - \frac{b^{2} d n^{2} \log{\left (x \right )}^{2}}{x} - \frac{2 b^{2} d n^{2} \log{\left (x \right )}}{x} - \frac{2 b^{2} d n^{2}}{x} - \frac{2 b^{2} d n \log{\left (c \right )} \log{\left (x \right )}}{x} - \frac{2 b^{2} d n \log{\left (c \right )}}{x} - \frac{b^{2} d \log{\left (c \right )}^{2}}{x} - b^{2} e \left (\begin{cases} - \log{\left (c \right )}^{2} \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{\log{\left (c x^{n} \right )}^{3}}{3 n} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2/x**2,x)

[Out]

-a**2*d/x + a**2*e*log(x) - 2*a*b*d*n/x - 2*a*b*d*log(c*x**n)/x - 2*a*b*e*Piecewise((-log(c)*log(x), Eq(n, 0))
, (-log(c*x**n)**2/(2*n), True)) - b**2*d*n**2*log(x)**2/x - 2*b**2*d*n**2*log(x)/x - 2*b**2*d*n**2/x - 2*b**2
*d*n*log(c)*log(x)/x - 2*b**2*d*n*log(c)/x - b**2*d*log(c)**2/x - b**2*e*Piecewise((-log(c)**2*log(x), Eq(n, 0
)), (-log(c*x**n)**3/(3*n), True))

________________________________________________________________________________________

Giac [B]  time = 1.20569, size = 232, normalized size = 3.22 \begin{align*} \frac{b^{2} n^{2} x e \log \left (x\right )^{3} + 3 \, b^{2} n x e \log \left (c\right ) \log \left (x\right )^{2} + 3 \, b^{2} x e \log \left (c\right )^{2} \log \left (x\right ) - 3 \, b^{2} d n^{2} \log \left (x\right )^{2} + 3 \, a b n x e \log \left (x\right )^{2} - 6 \, b^{2} d n^{2} \log \left (x\right ) - 6 \, b^{2} d n \log \left (c\right ) \log \left (x\right ) + 6 \, a b x e \log \left (c\right ) \log \left (x\right ) - 6 \, b^{2} d n^{2} - 6 \, b^{2} d n \log \left (c\right ) - 3 \, b^{2} d \log \left (c\right )^{2} - 6 \, a b d n \log \left (x\right ) + 3 \, a^{2} x e \log \left (x\right ) - 6 \, a b d n - 6 \, a b d \log \left (c\right ) - 3 \, a^{2} d}{3 \, x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^2,x, algorithm="giac")

[Out]

1/3*(b^2*n^2*x*e*log(x)^3 + 3*b^2*n*x*e*log(c)*log(x)^2 + 3*b^2*x*e*log(c)^2*log(x) - 3*b^2*d*n^2*log(x)^2 + 3
*a*b*n*x*e*log(x)^2 - 6*b^2*d*n^2*log(x) - 6*b^2*d*n*log(c)*log(x) + 6*a*b*x*e*log(c)*log(x) - 6*b^2*d*n^2 - 6
*b^2*d*n*log(c) - 3*b^2*d*log(c)^2 - 6*a*b*d*n*log(x) + 3*a^2*x*e*log(x) - 6*a*b*d*n - 6*a*b*d*log(c) - 3*a^2*
d)/x